<?php


namespace app\common\model;


use think\model;

class Grade extends Model
{
    //  连接数据库
    protected $connection = 'mysql';
    //  连接表名
    protected $name = 'grade';
    //  自动写入时间戳字段
    protected $createTime = 'create_at';
    protected $updateTime = 'update_at';

    // 分页查询,获取列表
    public function fetchListByWhere($where, $order = ['id' => 'desc'], $field = '*', $page = 1, $pageSize = 10)
    {
        return $this->field($field)->where($where)->order($order)->page($page, $pageSize)->select()->toArray();
    }

}